<template>
	<view>
		<!-- 获取定位 -->
		<view class="cu-form-group" @click.stop="chooseAddress">
			<view class="title">当前城市</view>
			<view>
				<text>{{address?address : '请选择'}}</text>
				<text class="cuIcon-right"></text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				address:'',
			}
		},
		methods: {
			chooseAddress(){
				uni.chooseLocation({
				    success:  (res) => {
				        console.log('位置名称：' + res.name);
				        console.log('详细地址：' + res.address);
				        console.log('纬度：' + res.latitude);
				        console.log('经度：' + res.longitude);
						this.address = res.address
				    }
				});
				
				
			}
		}
	}
</script>

<style>

</style>
